package com.open.rbac.model;

import java.util.List;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

/**
 * 路由
 * 务必设置：属性为NULL时不序列化
 *
 * @author Riche's
 * @since 2025/8/26
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class VueRouter {

    private String path;

    private String name;

    private String redirect;

    private String component;

    private Boolean showParent;

    private Meta meta;

    private List<VueRouter> children;

    /**
     * 路由元数据
     * 务必设置 {@link @JsonInclude(JsonInclude.Include.NON_NULL)}
     * 否则前端无法加载菜单
     */
    @Data
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class Meta {

        private String title;

        private Integer rank;

        private String icon;

        /**
         * 按钮权限
         */
        private List<String> auths;
    }

}
